import React, { useState } from 'react';
import { connect } from 'umi';
import { Modal, Tag } from 'antd';
import { Column } from '@ant-design/charts';
import { Tabs, Space } from 'antd';
import { useEffect } from 'react';
const TagSet = (props) => {
  const { id, filterSelect, onSelect, dispatch, selectList } = props;
  const [list, setList] = useState([
    {
      key: '姓名',
      value: 'username',
    },
    {
      key: '手机',
      value: 'mobile',
    },
    {
      key: '描述',
      value: 'userDesc',
    },
    {
      key: '意向课程',
      value: 'intentionCourses',
    },
    {
      key: '目标课程',
      value: 'targetCourse',
    },
    {
      key: '学校',
      value: 'schoolId',
    },
    {
      key: '专业',
      value: 'specialtyId',
    },
    {
      key: '毕业年份',
      value: 'examYear',
    },
    {
      key: '意向方向',
      value: 'intentionDirection',
    },
    {
      key: '意向度',
      value: 'intention',
    },
    {
      key: '标签',
      value: 'tagIds',
    },
    {
      key: '三方平台微信',
      value: 'thirdWechatBindFlag',
    },
    {
      key: '绑定微信',
      value: 'wechatBindFlag',
    },
  ]);

  return (
    <Space wrap={true}>
      {list.map((item, index) => {
        const { value, key } = item;
        return (
          <Tag
            style={
              filterSelect(value)
                ? { fontSize: 14, border: '1px solid #1890ff', color: '#1890ff', cursor: 'pointer' }
                : { cursor: 'pointer' }
            }
            onClick={() => onSelect(item)}
            key={index}
          >
            {key}
          </Tag>
        );
      })}
    </Space>
  );
};

export default connect(({ user, loading }) => ({
  loading: loading.models.behaviorEecord,
}))(TagSet);
